//
//  CBActiveTextColorTransformer.m
//  Cashbox
//
//  Created by Whitney Young on 8/21/06.
//  Copyright 2006 __MyCompanyName__. All rights reserved.
//

#import "CBActiveTextColorTransformer.h"


@implementation CBActiveTextColorTransformer

+ (Class)transformedValueClass {
    return [NSColor class];
}

+ (BOOL)allowsReverseTransformation {
    return NO;   
}

- (id)transformedValue:(id)value {
    BOOL input;    
    
	if (value == nil) return [NSColor controlTextColor];	
	if ([value respondsToSelector:@selector(boolValue)]) { input = [value boolValue]; }
	else { [NSException raise:NSInternalInconsistencyException format:@"Value (%@) does not respond to -boolValue.", [value class]]; }
	return (input ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]);
}

@end
